import React, { Component } from "react";
import { Table, Button } from "antd";
import LinkButton from "../../components/link-button/index";
const columns = [
  {
    title: "文件名",
    dataIndex: "name",
    render: (text) => <LinkButton style={{ color: "red" }}>{text}</LinkButton>,
  },
  {
    title: "度量值",
    dataIndex: "age",
    render: (text) => <span style={{ color: "red" }}>{text}</span>,
  },
  {
    title: "软件类型",
    dataIndex: "address",
    render: (text) => <span style={{ color: "red" }}>{text}</span>,
  },
  {
    title: "时间",
    dataIndex: "time",
    render: (text) => <span style={{ color: "red" }}>{text}</span>,
  },
  {
    title: "操作",
    render: () => (
      <div>
        <LinkButton style={{ color: "red" }}>详情</LinkButton>&nbsp;&nbsp;
        <LinkButton style={{ color: "red" }}>删除</LinkButton>
      </div>
    ),
  },
];
const data = [
  {
    key: "1",
    name: "deploy. _tee exe",
    age: "C3A7F9C86E717E1E284709E38231...",
    address: "deplioy_ftee exe",
    time: "2019-07-06 01：03",
  },
  {
    key: "2",
    name: "3602ip exe",
    age: "7734FD66675ADC617337E952A70h...",
    address: "3602ip exe",
    time: "2019-07-06 01：03",
  },
  {
    key: "3",
    name: "ligcn.exe",
    age: "62F006178C2F577A1E32ADEE8B50...",
    address: "ligcn.exe",
    time: "2019-07-06 01：03",
  },
  {
    key: "4",
    name: "Rar.exe",
    age: "01576609B4657B0A409FA420LB3...",
    address: "Rar.exe",
    time: "2019-07-06 01：03",
  },
];

// rowSelection object indicates the need for row selection
const rowSelection = {
  onChange: (selectedRowKeys, selectedRows) => {
    console.log(
      `selectedRowKeys: ${selectedRowKeys}`,
      "selectedRows: ",
      selectedRows
    );
  },
  getCheckboxProps: (record) => ({
    name: record.name,
  }),
};
class police extends Component {
  constructor(props) {
    super(props);
    this.state = {};
  }
  render() {
    return (
      <div style={{ float: "left", width: "80%" }}>
        <Table
          rowSelection={rowSelection}
          columns={columns}
          dataSource={data}
        />
        <Button type="danger">删除选中</Button>&nbsp;&nbsp;
        <Button type="danger">全部删除</Button>
      </div>
    );
  }
}

export default police;
